.class public Lrexsee/natives/clazz/GalleryAdapter;
.super Landroid/widget/BaseAdapter;
.source "GalleryAdapter.java"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mDrawablePathes:[Ljava/lang/String;

.field private final mGallery:Landroid/widget/Gallery;

.field private final mIconBg:Landroid/graphics/drawable/Drawable;

.field private final mParent:Lrexsee/natives/ViewTag;

.field private final mStyle:Lrexsee/core/style/StyleSheet;

.field private final mViews:[Landroid/view/View;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Lrexsee/natives/ViewTag;[Landroid/view/View;)V
    .locals 6
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "parent"    # Lrexsee/natives/ViewTag;
    .param p3, "options"    # [Landroid/view/View;

    .prologue
    const/4 v5, -0x1

    const/4 v3, 0x0

    .line 43
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 44
    iput-object p1, p0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    .line 45
    iput-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mDrawablePathes:[Ljava/lang/String;

    .line 46
    iput-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mIconBg:Landroid/graphics/drawable/Drawable;

    .line 47
    iput-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    .line 48
    array-length v3, p3

    new-array v3, v3, [Landroid/view/View;

    iput-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    .line 49
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    array-length v3, p3

    if-lt v0, v3, :cond_0

    .line 60
    iput-object p2, p0, Lrexsee/natives/clazz/GalleryAdapter;->mParent:Lrexsee/natives/ViewTag;

    .line 61
    iget-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mParent:Lrexsee/natives/ViewTag;

    iget-object v3, v3, Lrexsee/natives/ViewTag;->view:Landroid/view/View;

    check-cast v3, Landroid/widget/Gallery;

    iput-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mGallery:Landroid/widget/Gallery;

    .line 62
    return-void

    .line 50
    :cond_0
    iget-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    aget-object v4, p3, v0

    aput-object v4, v3, v0

    .line 52
    iget-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    aget-object v3, v3, v0

    invoke-virtual {v3}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lrexsee/natives/ViewTag;

    .line 53
    .local v2, "tag":Lrexsee/natives/ViewTag;
    if-eqz v2, :cond_1

    .line 54
    new-instance v1, Landroid/widget/Gallery$LayoutParams;

    iget-object v3, v2, Lrexsee/natives/ViewTag;->style:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getWidth()I

    move-result v3

    iget-object v4, v2, Lrexsee/natives/ViewTag;->style:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v4}, Lrexsee/core/style/StyleSheet;->getHeight()I

    move-result v4

    invoke-direct {v1, v3, v4}, Landroid/widget/Gallery$LayoutParams;-><init>(II)V

    .line 58
    .local v1, "layoutParams":Landroid/widget/Gallery$LayoutParams;
    :goto_1
    iget-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    aget-object v3, v3, v0

    invoke-virtual {v3, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 49
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 56
    .end local v1    # "layoutParams":Landroid/widget/Gallery$LayoutParams;
    :cond_1
    new-instance v1, Landroid/widget/Gallery$LayoutParams;

    invoke-direct {v1, v5, v5}, Landroid/widget/Gallery$LayoutParams;-><init>(II)V

    .restart local v1    # "layoutParams":Landroid/widget/Gallery$LayoutParams;
    goto :goto_1
.end method

.method public constructor <init>(Lrexsee/core/browser/Browser;Lrexsee/natives/ViewTag;[Ljava/lang/String;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "parent"    # Lrexsee/natives/ViewTag;
    .param p3, "options"    # [Ljava/lang/String;

    .prologue
    .line 34
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 35
    iput-object p1, p0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    .line 36
    iput-object p3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mDrawablePathes:[Ljava/lang/String;

    .line 37
    array-length v0, p3

    new-array v0, v0, [Landroid/view/View;

    iput-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    .line 38
    iget-object v0, p2, Lrexsee/natives/ViewTag;->style:Lrexsee/core/style/StyleSheet;

    iput-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    .line 39
    iget-object v0, p2, Lrexsee/natives/ViewTag;->style:Lrexsee/core/style/StyleSheet;

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->icon_background_color:Ljava/lang/String;

    const/4 v1, 0x0

    invoke-static {p1, v0, v1}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mIconBg:Landroid/graphics/drawable/Drawable;

    .line 40
    iput-object p2, p0, Lrexsee/natives/clazz/GalleryAdapter;->mParent:Lrexsee/natives/ViewTag;

    .line 41
    iget-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mParent:Lrexsee/natives/ViewTag;

    iget-object v0, v0, Lrexsee/natives/ViewTag;->view:Landroid/view/View;

    check-cast v0, Landroid/widget/Gallery;

    iput-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mGallery:Landroid/widget/Gallery;

    .line 42
    return-void
.end method

.method static synthetic access$0(Lrexsee/natives/clazz/GalleryAdapter;)Landroid/widget/Gallery;
    .locals 1

    .prologue
    .line 31
    iget-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mGallery:Landroid/widget/Gallery;

    return-object v0
.end method

.method private createImageView(Ljava/lang/String;)Landroid/widget/ImageView;
    .locals 21
    .param p1, "path"    # Ljava/lang/String;

    .prologue
    .line 90
    :try_start_0
    new-instance v12, Landroid/widget/ImageView;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v17

    move-object v0, v12

    move-object/from16 v1, v17

    invoke-direct {v0, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 91
    .local v12, "imageView":Landroid/widget/ImageView;
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mIconBg:Landroid/graphics/drawable/Drawable;

    move-object/from16 v17, v0

    if-eqz v17, :cond_0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mIconBg:Landroid/graphics/drawable/Drawable;

    move-object/from16 v17, v0

    move-object v0, v12

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 92
    :cond_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/style/StyleSheet;->getIconPaddingLeft()I

    move-result v17

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v18, v0

    invoke-virtual/range {v18 .. v18}, Lrexsee/core/style/StyleSheet;->getIconPaddingTop()I

    move-result v18

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v19, v0

    invoke-virtual/range {v19 .. v19}, Lrexsee/core/style/StyleSheet;->getIconPaddingRight()I

    move-result v19

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v20, v0

    invoke-virtual/range {v20 .. v20}, Lrexsee/core/style/StyleSheet;->getIconPaddingBottom()I

    move-result v20

    move-object v0, v12

    move/from16 v1, v17

    move/from16 v2, v18

    move/from16 v3, v19

    move/from16 v4, v20

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/widget/ImageView;->setPadding(IIII)V

    .line 93
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/style/StyleSheet;->getIconScaleType()Landroid/widget/ImageView$ScaleType;

    move-result-object v17

    move-object v0, v12

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 95
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->icon_bounds:Ljava/lang/String;

    move-object/from16 v17, v0

    const/16 v18, -0x1

    invoke-static/range {v17 .. v18}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v6

    .line 98
    .local v6, "bounds":I
    if-lez v6, :cond_5

    .line 99
    new-instance v9, Ljava/io/File;

    invoke-static/range {p1 .. p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v17

    invoke-virtual/range {v17 .. v17}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;

    move-result-object v17

    move-object v0, v9

    move-object/from16 v1, v17

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 100
    .local v9, "file":Ljava/io/File;
    if-eqz v9, :cond_4

    invoke-virtual {v9}, Ljava/io/File;->isFile()Z

    move-result v17

    if-eqz v17, :cond_4

    invoke-virtual {v9}, Ljava/io/File;->canRead()Z

    move-result v17

    if-eqz v17, :cond_4

    .line 101
    new-instance v15, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v15}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 102
    .local v15, "options":Landroid/graphics/BitmapFactory$Options;
    const/16 v17, 0x1

    move/from16 v0, v17

    move-object v1, v15

    iput-boolean v0, v1, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 103
    invoke-virtual {v9}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    move-object v1, v15

    invoke-static {v0, v1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 104
    .local v5, "bitmap":Landroid/graphics/Bitmap;
    const/16 v17, 0x0

    move/from16 v0, v17

    move-object v1, v15

    iput-boolean v0, v1, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 105
    const/16 v17, 0x1

    move-object v0, v15

    iget v0, v0, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    move/from16 v18, v0

    div-int v18, v18, v6

    move-object v0, v15

    iget v0, v0, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    move/from16 v19, v0

    div-int v19, v19, v6

    invoke-static/range {v18 .. v19}, Ljava/lang/Math;->max(II)I

    move-result v18

    move/from16 v0, v18

    int-to-float v0, v0

    move/from16 v18, v0

    invoke-static/range {v18 .. v18}, Ljava/lang/Math;->round(F)I

    move-result v18

    invoke-static/range {v17 .. v18}, Ljava/lang/Math;->max(II)I

    move-result v17

    move/from16 v0, v17

    move-object v1, v15

    iput v0, v1, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 106
    invoke-virtual {v9}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v17

    move-object/from16 v0, v17

    move-object v1, v15

    invoke-static {v0, v1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 107
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->effect:Ljava/lang/String;

    move-object/from16 v17, v0

    const-string v18, "reflectshader"

    invoke-virtual/range {v17 .. v18}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v17

    if-eqz v17, :cond_1

    const/high16 v17, 0x3f000000    # 0.5f

    move-object v0, v5

    move/from16 v1, v17

    invoke-static {v0, v1}, Lrexsee/core/style/RexseeDrawable;->createReflectShader(Landroid/graphics/Bitmap;F)Landroid/graphics/Bitmap;

    move-result-object v17

    move-object/from16 v5, v17

    .line 108
    :cond_1
    new-instance v17, Landroid/graphics/drawable/BitmapDrawable;

    move-object/from16 v0, v17

    move-object v1, v5

    invoke-direct {v0, v1}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    move-object v0, v12

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 109
    invoke-virtual {v5}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v13

    .line 110
    .local v13, "imageWidth":I
    invoke-virtual {v5}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v11

    .line 134
    .end local v5    # "bitmap":Landroid/graphics/Bitmap;
    .end local v9    # "file":Ljava/io/File;
    .end local v15    # "options":Landroid/graphics/BitmapFactory$Options;
    .local v11, "imageHeight":I
    :goto_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/style/StyleSheet;->getIconWidth()I

    move-result v16

    .line 135
    .local v16, "w":I
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/style/StyleSheet;->getIconHeight()I

    move-result v10

    .line 136
    .local v10, "h":I
    const/16 v17, -0x2

    move/from16 v0, v16

    move/from16 v1, v17

    if-ne v0, v1, :cond_9

    .line 137
    move/from16 v16, v13

    .line 141
    :cond_2
    :goto_1
    const/16 v17, -0x2

    move v0, v10

    move/from16 v1, v17

    if-ne v0, v1, :cond_a

    .line 142
    move v10, v11

    .line 147
    :cond_3
    :goto_2
    new-instance v14, Landroid/widget/Gallery$LayoutParams;

    move-object v0, v14

    move/from16 v1, v16

    move v2, v10

    invoke-direct {v0, v1, v2}, Landroid/widget/Gallery$LayoutParams;-><init>(II)V

    .line 148
    .local v14, "layoutParams":Landroid/widget/Gallery$LayoutParams;
    invoke-virtual {v12, v14}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 150
    move-object/from16 v0, p0

    move-object v1, v12

    move/from16 v2, v16

    move v3, v10

    invoke-virtual {v0, v1, v2, v3}, Lrexsee/natives/clazz/GalleryAdapter;->setTouchListener(Landroid/widget/ImageView;II)V

    move-object/from16 v17, v12

    .line 156
    .end local v6    # "bounds":I
    .end local v10    # "h":I
    .end local v11    # "imageHeight":I
    .end local v12    # "imageView":Landroid/widget/ImageView;
    .end local v13    # "imageWidth":I
    .end local v14    # "layoutParams":Landroid/widget/Gallery$LayoutParams;
    .end local v16    # "w":I
    :goto_3
    return-object v17

    .line 112
    .restart local v6    # "bounds":I
    .restart local v9    # "file":Ljava/io/File;
    .restart local v12    # "imageView":Landroid/widget/ImageView;
    :cond_4
    const/4 v13, 0x0

    .line 113
    .restart local v13    # "imageWidth":I
    const/4 v11, 0x0

    .restart local v11    # "imageHeight":I
    goto :goto_0

    .line 116
    .end local v9    # "file":Ljava/io/File;
    .end local v11    # "imageHeight":I
    .end local v13    # "imageWidth":I
    :cond_5
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    move-object/from16 v17, v0

    const/16 v18, 0x0

    move-object/from16 v0, v17

    move-object/from16 v1, p1

    move-object/from16 v2, v18

    invoke-static {v0, v1, v2}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v7

    .line 117
    .local v7, "drawable":Landroid/graphics/drawable/Drawable;
    if-eqz v7, :cond_7

    .line 118
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->effect:Ljava/lang/String;

    move-object/from16 v17, v0

    const-string v18, "reflectshader"

    invoke-virtual/range {v17 .. v18}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v17

    if-eqz v17, :cond_6

    const/high16 v17, 0x3f000000    # 0.5f

    move-object v0, v7

    move/from16 v1, v17

    invoke-static {v0, v1}, Lrexsee/core/style/RexseeDrawable;->createReflectShader(Landroid/graphics/drawable/Drawable;F)Landroid/graphics/drawable/Drawable;

    move-result-object v17

    move-object/from16 v7, v17

    .line 119
    :cond_6
    invoke-virtual {v12, v7}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 120
    invoke-virtual {v7}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v13

    .line 121
    .restart local v13    # "imageWidth":I
    invoke-virtual {v7}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v11

    .restart local v11    # "imageHeight":I
    goto :goto_0

    .line 123
    .end local v11    # "imageHeight":I
    .end local v13    # "imageWidth":I
    :cond_7
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v17, v0

    if-eqz v17, :cond_8

    .line 124
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v17, v0

    move-object v0, v12

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 125
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v13

    .line 126
    .restart local v13    # "imageWidth":I
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    move-object/from16 v0, v17

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v11

    .restart local v11    # "imageHeight":I
    goto/16 :goto_0

    .line 128
    .end local v11    # "imageHeight":I
    .end local v13    # "imageWidth":I
    :cond_8
    const/4 v13, 0x0

    .line 129
    .restart local v13    # "imageWidth":I
    const/4 v11, 0x0

    .restart local v11    # "imageHeight":I
    goto/16 :goto_0

    .line 138
    .end local v7    # "drawable":Landroid/graphics/drawable/Drawable;
    .restart local v10    # "h":I
    .restart local v16    # "w":I
    :cond_9
    const/16 v17, -0x1

    move/from16 v0, v16

    move/from16 v1, v17

    if-ne v0, v1, :cond_2

    .line 139
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/style/StyleSheet;->getWidth()I

    move-result v16

    goto/16 :goto_1

    .line 143
    :cond_a
    const/16 v17, -0x1

    move v0, v10

    move/from16 v1, v17

    if-ne v0, v1, :cond_3

    .line 144
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    move-object/from16 v17, v0

    invoke-virtual/range {v17 .. v17}, Lrexsee/core/style/StyleSheet;->getHeight()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v10

    goto/16 :goto_2

    .line 154
    .end local v6    # "bounds":I
    .end local v10    # "h":I
    .end local v11    # "imageHeight":I
    .end local v12    # "imageView":Landroid/widget/ImageView;
    .end local v13    # "imageWidth":I
    .end local v16    # "w":I
    :catch_0
    move-exception v17

    move-object/from16 v8, v17

    .line 155
    .local v8, "e":Ljava/lang/Exception;
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    move-object/from16 v17, v0

    invoke-virtual/range {p0 .. p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v18

    move-object/from16 v0, v17

    move-object/from16 v1, v18

    move-object v2, v8

    invoke-virtual {v0, v1, v2}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    .line 156
    const/16 v17, 0x0

    goto/16 :goto_3
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 166
    iget-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    array-length v0, v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .param p1, "position"    # I

    .prologue
    .line 170
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .param p1, "position"    # I

    .prologue
    .line 174
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 1
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    .line 162
    iget-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mDrawablePathes:[Ljava/lang/String;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mDrawablePathes:[Ljava/lang/String;

    aget-object v0, v0, p1

    invoke-direct {p0, v0}, Lrexsee/natives/clazz/GalleryAdapter;->createImageView(Ljava/lang/String;)Landroid/widget/ImageView;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lrexsee/natives/clazz/GalleryAdapter;->mViews:[Landroid/view/View;

    aget-object v0, v0, p1

    goto :goto_0
.end method

.method public setTouchListener(Landroid/widget/ImageView;II)V
    .locals 8
    .param p1, "imageView"    # Landroid/widget/ImageView;
    .param p2, "width"    # I
    .param p3, "height"    # I

    .prologue
    const-string v7, "true"

    .line 65
    iget-object v1, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v1, v1, Lrexsee/core/style/StyleSheet;->distance_threshold:Ljava/lang/String;

    const/4 v2, 0x0

    invoke-static {v1, v2}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v4

    .line 66
    .local v4, "threshold":I
    if-lez v4, :cond_0

    iget-object v1, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v1, v1, Lrexsee/core/style/StyleSheet;->event_touch:Ljava/lang/String;

    const-string v2, "true"

    invoke-virtual {v1, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 67
    const/4 v1, 0x1

    invoke-virtual {p1, v1}, Landroid/widget/ImageView;->setClickable(Z)V

    .line 68
    iget-object v1, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v1, v1, Lrexsee/core/style/StyleSheet;->event_multitouch:Ljava/lang/String;

    const-string v2, "true"

    invoke-virtual {v1, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 69
    sget-object v1, Landroid/widget/ImageView$ScaleType;->CENTER_INSIDE:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {p1, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 70
    new-instance v0, Lrexsee/dialog/ImageMultiTouchListener;

    new-instance v5, Lrexsee/natives/clazz/GalleryAdapter$1;

    invoke-direct {v5, p0}, Lrexsee/natives/clazz/GalleryAdapter$1;-><init>(Lrexsee/natives/clazz/GalleryAdapter;)V

    move-object v1, p1

    move v2, p2

    move v3, p3

    invoke-direct/range {v0 .. v5}, Lrexsee/dialog/ImageMultiTouchListener;-><init>(Landroid/widget/ImageView;IIILrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;)V

    .line 82
    .local v0, "multiTouchListener":Lrexsee/dialog/ImageMultiTouchListener;
    new-instance v1, Lrexsee/natives/clazz/ViewOnTouchListener;

    iget-object v2, p0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mParent:Lrexsee/natives/ViewTag;

    iget-object v3, v3, Lrexsee/natives/ViewTag;->id:Ljava/lang/String;

    iget-object v5, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v5, v5, Lrexsee/core/style/StyleSheet;->event_touchmove:Ljava/lang/String;

    const-string v6, "true"

    invoke-virtual {v5, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    invoke-direct {v1, v2, v3, v5, v0}, Lrexsee/natives/clazz/ViewOnTouchListener;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;ZLrexsee/dialog/ImageMultiTouchListener;)V

    invoke-virtual {p1, v1}, Landroid/widget/ImageView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 87
    .end local v0    # "multiTouchListener":Lrexsee/dialog/ImageMultiTouchListener;
    :cond_0
    :goto_0
    return-void

    .line 84
    :cond_1
    new-instance v1, Lrexsee/natives/clazz/ViewOnTouchListener;

    iget-object v2, p0, Lrexsee/natives/clazz/GalleryAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, p0, Lrexsee/natives/clazz/GalleryAdapter;->mParent:Lrexsee/natives/ViewTag;

    iget-object v3, v3, Lrexsee/natives/ViewTag;->id:Ljava/lang/String;

    iget-object v5, p0, Lrexsee/natives/clazz/GalleryAdapter;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v5, v5, Lrexsee/core/style/StyleSheet;->event_touchmove:Ljava/lang/String;

    const-string v6, "true"

    invoke-virtual {v5, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    const/4 v6, 0x0

    invoke-direct {v1, v2, v3, v5, v6}, Lrexsee/natives/clazz/ViewOnTouchListener;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;ZLrexsee/dialog/ImageMultiTouchListener;)V

    invoke-virtual {p1, v1}, Landroid/widget/ImageView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    goto :goto_0
.end method
